package com.zzptc.syl.traffic;

import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.PagerAdapter;

import java.util.ArrayList;

public class MyPagerAdapter extends FragmentPagerAdapter {
    private ArrayList<Fragment> viewLists;

    public MyPagerAdapter(@NonNull FragmentManager fm, int behavior, ArrayList<Fragment> viewLists) {
        super(fm, behavior);
        this.viewLists = viewLists;
    }

    @Override
    public int getCount() {
        return viewLists.size();
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return viewLists.get(position);
    }

}
